package cate.game.train.hero.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import cate.game.res.CostSelect;
import easy.java.dev.note.NoteField;

import java.util.Map;

@ClientMsg(title = "英雄升星 の 请求")
@OperationSetter(GDOperation.HERO_STAR_UP)
public class HeroStarUpReq implements MsgInput {
    @NoteField(value = "升星目标英雄的唯一ID", detail = "要对哪个英雄升星")
    public String uid;

    @NoteField(value = "耗材选择", detail = "M<制定格子的index,选择指定格子的消耗>")
    public Map<Integer, CostSelect> csbbMap;

    @NoteField(value = "任务id", detail = "分段和飞升阶段才有")
    public int taskId;

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.HERO_START_UP_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        game.train.hero.starUp(cc.getRole(), uid, csbbMap, taskId);
    }
}
